this.connect('destroy', this._onDestroy.bind(this));
- this._userWell = new St.Bin({ x_fill: true, x_align: St.Align.START });
- this.add(this._userWell, {
- x_align: St.Align.START,
+ this._userWell = new St.Bin({
x_fill: true,
- y_fill: true,
- expand: true
+ x_align: St.Align.START,
+ x_expand: true,
+ y_expand: true,
+ });
+ this.add_child(this._userWell);
+ this._label = new St.Label({
+ style_class: 'login-dialog-prompt-label',
+ x_expand: false,
+ y_expand: true,
});
- this._label = new St.Label({ style_class: 'login-dialog-prompt-label' });
- this.add(this._label, {
- expand: true,
- x_fill: false,
- y_fill: true,
- x_align: St.Align.START
+ this.add_child(this._label);
+ this._entry = new St.Entry({
+ style_class: 'login-dialog-prompt-entry',
+ can_focus: true,
+ x_expand: false,
+ y_expand: true,
});
- this._entry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
- can_focus: true });
ShellEntry.addContextMenu(this._entry, { isPassword: true, actionMode: Shell.ActionMode.NONE });
- this.add(this._entry, {
- expand: true,
- x_fill: true,
- y_fill: false,
- x_align: St.Align.START
- });
+ this.add_child(this._entry);
this._entry.grab_key_focus();
- this._message = new St.Label({ opacity: 0,
- styleClass: 'login-dialog-message' });
+ this._message = new St.Label({
+ opacity: 0,
+ styleClass: 'login-dialog-message',
+ x_expand: false,
+ y_expand: true,
+ y_align: Clutter.ActorAlign.START,
+ });
this._message.clutter_text.line_wrap = true;
this._message.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
- this.add(this._message, { x_fill: false, x_align: St.Align.START, y_align: St.Align.START });
-
- this._buttonBox = new St.BoxLayout({ style_class: 'login-dialog-button-box',
- vertical: false });
- this.add(this._buttonBox, {
- expand: true,
- x_align: St.Align.MIDDLE,
- y_align: St.Align.END
+ this.add_child(this._message);
+
+ this._buttonBox = new St.BoxLayout({
+ style_class: 'login-dialog-button-box',
+ vertical: false,
+ y_align: Clutter.ActorAlign.END,
});
+ this.add_child(this._buttonBox);
- this._defaultButtonWell = new St.Widget({ layout_manager: new Clutter.BinLayout() });
- this._defaultButtonWellActor = null;
+ this._defaultButtonWell = new St.Widget({
+ layout_manager: new Clutter.BinLayout(),
+ x_align: Clutter.ActorAlign.END,
+ y_align: Clutter.ActorAlign.CENTER,
+ });
this._initButtons();
}
_initButtons() {
- this.cancelButton = new St.Button({ style_class: 'modal-dialog-button button',
- button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
- reactive: true,
- can_focus: true,
- label: _("Cancel") });
+ this.cancelButton = new St.Button({
+ style_class: 'modal-dialog-button button',
+ button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
+ reactive: true,
+ can_focus: true,
+ label: _("Cancel"),
+ x_expand: true,
+ });
+ this.cancelButton.set_x_align(Clutter.ActorAlign.START);
+ this.cancelButton.set_y_align(Clutter.ActorAlign.END);
this.cancelButton.connect('clicked', () => this.cancel());
- this._buttonBox.add(this.cancelButton,
- { expand: false,
- x_fill: false,
- y_fill: false,
- x_align: St.Align.START,
- y_align: St.Align.END });
-
- this._buttonBox.add(this._defaultButtonWell,
- { expand: true,
- x_fill: false,
- y_fill: false,
- x_align: St.Align.END,
- y_align: St.Align.MIDDLE });
- this.nextButton = new St.Button({ style_class: 'modal-dialog-button button',
- button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
- reactive: true,
- can_focus: true,
- label: _("Next") });
+ this._buttonBox.add_child(this.cancelButton);
+
+ this._buttonBox.add_child(this._defaultButtonWell);
+ this.nextButton = new St.Button({
+ style_class: 'modal-dialog-button button',
+ button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
+ reactive: true,
+ can_focus: true,
+ label: _("Next"),
+ });
+ this.nextButton.set_x_align(Clutter.ActorAlign.END);
+ this.nextButton.set_y_align(Clutter.ActorAlign.END);
this.nextButton.connect('clicked', () => this.emit('next'));
this.nextButton.add_style_pseudo_class('default');
- this._buttonBox.add(this.nextButton,
- { expand: false,
- x_fill: false,
- y_fill: false,
- x_align: St.Align.END,
- y_align: St.Align.END });
+ this._buttonBox.add_child(this.nextButton);
this._updateNextButtonSensitivity(this._entry.text.length > 0);
style_class: 'login-dialog-user-list-item',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
can_focus: true,
+ x_expand: true,
child: layout,
reactive: true,
x_align: St.Align.START,
}
}, class UserList extends St.ScrollView {
_init() {
- super._init({ style_class: 'login-dialog-user-list-view' });
+ super._init({
+ style_class: 'login-dialog-user-list-view',
+ x_expand: true,
+ y_expand: true,
+ });
this.set_policy(St.PolicyType.NEVER,
St.PolicyType.AUTOMATIC);
this.removeUser(user);
let item = new UserListItem(user);
- this._box.add(item, { x_fill: true });
+ this._box.add_child(item);
this._items[userName] = item;
this.add_child(this._userSelectionBox);
this._userList = new UserList();
- this._userSelectionBox.add(this._userList,
- { expand: true,
- x_fill: true,
- y_fill: true });
+ this._userSelectionBox.add_child(this._userList);
this._authPrompt = new AuthPrompt.AuthPrompt(this._gdmClient, AuthPrompt.AuthPromptMode.UNLOCK_OR_LOG_IN);
this._authPrompt.connect('prompted', this._onPrompted.bind(this));
this._notListedButton.hide();
- this._userSelectionBox.add(this._notListedButton,
- { expand: false,
- x_align: St.Align.START,
- x_fill: true });
+ this._userSelectionBox.add_child(this._notListedButton);
this._bannerView = new St.ScrollView({ style_class: 'login-dialog-banner-view',
opacity: 0,
this.icon = null;
this._iconBin = new St.Bin({ x_fill: true, y_fill: true });
- this.add(this._iconBin, { x_fill: false, y_fill: false } );
- this.label = new St.Label({ text: this.app.get_name() });
- this.add(this.label, { x_fill: false });
+ this.add_child(this._iconBin);
+ this.label = new St.Label({
+ text: this.app.get_name(),
+ x_align: Clutter.ActorAlign.CENTER,
+ });
+ this.add_child(this.label);
}
// eslint-disable-next-line camelcase
this._icon = new St.Widget({ layout_manager: new Clutter.BinLayout() });
- this.add(this._icon, { x_fill: false, y_fill: false } );
+ this.add_child(this._icon);
this.label = new St.Label({ text: window.get_title() });
let tracker = Shell.WindowTracker.get_default();
this.contentLayout.style_class = 'audio-selection-content';
this.contentLayout.add(title);
- this._selectionBox = new St.BoxLayout({ style_class: 'audio-selection-box' });
- this.contentLayout.add(this._selectionBox, { expand: true });
+ this._selectionBox = new St.BoxLayout({
+ style_class: 'audio-selection-box',
+ x_expand: true,
+ });
+ this.contentLayout.add_child(this._selectionBox);
if (Main.sessionMode.allowSettings)
this.addButton({ action: this._openSettings.bind(this),
this._topBox.add(this._backButton);
this._backButton.connect('clicked', this._onPrevMonthButtonClicked.bind(this));
- this._monthLabel = new St.Label({ style_class: 'calendar-month-label',
- can_focus: true });
- this._topBox.add(this._monthLabel, { expand: true, x_fill: false, x_align: St.Align.MIDDLE });
+ this._monthLabel = new St.Label({
+ style_class: 'calendar-month-label',
+ can_focus: true,
+ x_align: Clutter.ActorAlign.CENTER,
+ x_expand: true,
+ });
+ this._topBox.add_child(this._monthLabel);
this._forwardButton = new St.Button({ style_class: 'calendar-change-month-forward pager-button',
accessible_name: _("Next month"),
_buildControlTable() {
let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
- let table = new St.Widget({ style_class: 'keyring-dialog-control-table',
- layout_manager: layout });
+ let table = new St.Widget({
+ style_class: 'keyring-dialog-control-table',
+ layout_manager: layout,
+ x_expand: true,
+ y_expand: true,
+ });
layout.hookup_style(table);
let rtl = table.get_text_direction() == Clutter.TextDirection.RTL;
let row = 0;
}
this._controlTable = table;
- this._content.messageBox.add(table, { x_fill: true, y_fill: true });
+ this._content.messageBox.add_child(table);
}
_updateSensitivity(sensitive) {
descriptionLabel.clutter_text.line_wrap = true;
descriptionLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
- contentBox.messageBox.add(descriptionLabel,
- { y_fill: true,
- y_align: St.Align.START,
- expand: true });
+ contentBox.messageBox.add_child(descriptionLabel);
}
this._okButton = {
if (userIsRoot) {
let userLabel = new St.Label(({ style_class: 'polkit-dialog-user-root-label',
text: userRealName }));
- content.messageBox.add(userLabel, { x_fill: false,
- x_align: St.Align.START });
+ content.messageBox.add_child(userLabel);
} else {
let userBox = new St.BoxLayout({ style_class: 'polkit-dialog-user-layout',
vertical: false });
{ iconSize: DIALOG_ICON_SIZE,
styleClass: 'polkit-dialog-user-icon' });
this._userAvatar.hide();
- userBox.add(this._userAvatar,
- { x_fill: true,
- y_fill: false,
- x_align: St.Align.END,
- y_align: St.Align.START });
- let userLabel = new St.Label(({ style_class: 'polkit-dialog-user-label',
- text: userRealName }));
- userBox.add(userLabel,
- { x_fill: true,
- y_fill: false,
- x_align: St.Align.END,
- y_align: St.Align.MIDDLE });
+ userBox.add_child(this._userAvatar);
+ let userLabel = new St.Label(({
+ style_class: 'polkit-dialog-user-label',
+ text: userRealName,
+ x_expand: true,
+ y_align: Clutter.ActorAlign.CENTER,
+ }));
+ userBox.add_child(userLabel);
}
this._onUserChanged();
this._passwordBox = new St.BoxLayout({ vertical: false, style_class: 'prompt-dialog-password-box' });
content.messageBox.add(this._passwordBox);
- this._passwordLabel = new St.Label(({ style_class: 'prompt-dialog-password-label' }));
- this._passwordBox.add(this._passwordLabel, { y_fill: false, y_align: St.Align.MIDDLE });
- this._passwordEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
- text: "",
- can_focus: true });
+ this._passwordLabel = new St.Label(({
+ style_class: 'prompt-dialog-password-label',
+ y_align: Clutter.ActorAlign.CENTER,
+ }));
+ this._passwordBox.add_child(this._passwordLabel);
+ this._passwordEntry = new St.Entry({
+ style_class: 'prompt-dialog-password-entry',
+ text: "",
+ can_focus: true,
+ x_expand: true,
+ });
ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
this._passwordEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
- this._passwordBox.add(this._passwordEntry,
- { expand: true });
+ this._passwordBox.add_child(this._passwordEntry);
this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, true);
this._passwordBox.add(this._workSpinner);
this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label' });
this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._errorMessageLabel.clutter_text.line_wrap = true;
- content.messageBox.add(this._errorMessageLabel, { x_fill: false, x_align: St.Align.START });
+ content.messageBox.add_child(this._errorMessageLabel);
this._errorMessageLabel.hide();
this._infoMessageLabel = new St.Label({ style_class: 'prompt-dialog-info-label' });
icon = new St.Icon({ icon_name: item.iconName,
icon_size: POPUP_APPICON_SIZE });
}
- box.add(icon, { x_fill: false, y_fill: false } );
+ box.add_child(icon);
- let text = new St.Label({ text: item.name });
- box.add(text, { x_fill: false });
+ let text = new St.Label({
+ text: item.name,
+ x_align: Clutter.ActorAlign.CENTER,
+ });
+ box.add_child(text);
this.addItem(box, text);
}
super._init({
style_class: 'world-clocks-button',
x_fill: true,
- can_focus: true
+ can_focus: true,
+ x_expand: true,
});
this._clock = new GnomeDesktop.WallClock();
this._clockNotifyId = 0;
super._init({
style_class: 'weather-button',
x_fill: true,
- can_focus: true
+ can_focus: true,
+ x_expand: true,
});
this._weatherClient = new Weather.WeatherClient();
// Fill up the first column
this._messageList = new Calendar.CalendarMessageList();
- hbox.add(this._messageList, { expand: true, y_fill: false, y_align: St.Align.START });
+ hbox.add_child(this._messageList);
// Fill up the second column
let boxLayout = new CalendarColumnLayout(this._calendar);
this._displaysSection.add_actor(displaysBox);
this._clocksItem = new WorldClocksSection();
- displaysBox.add(this._clocksItem, { x_fill: true });
+ displaysBox.add_child(this._clocksItem);
this._weatherItem = new WeatherSection();
- displaysBox.add(this._weatherItem, { x_fill: true });
+ displaysBox.add_child(this._weatherItem);
// Done with hbox for calendar and event list
this._dialog.request_mode = Clutter.RequestMode.HEIGHT_FOR_WIDTH;
this._dialog.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
- this.contentLayout = new St.BoxLayout({ vertical: true,
- style_class: "modal-dialog-content-box" });
- this._dialog.add(this.contentLayout,
- { expand: true,
- x_fill: true,
- y_fill: true,
- x_align: St.Align.MIDDLE,
- y_align: St.Align.START });
+ this.contentLayout = new St.BoxLayout({
+ vertical: true,
+ style_class: 'modal-dialog-content-box',
+ y_expand: true,
+ });
+ this._dialog.add_child(this.contentLayout);
this.buttonLayout = new St.Widget ({ layout_manager: new Clutter.BoxLayout({ homogeneous: true }) });
- this._dialog.add(this.buttonLayout,
- { x_align: St.Align.MIDDLE,
- y_align: St.Align.START });
+ this._dialog.add_child(this.buttonLayout);
}
_onDestroy() {
this._userLoadedId = this._user.connect('notify::is_loaded', this._sync.bind(this));
this._userChangedId = this._user.connect('changed', this._sync.bind(this));
- let mainContentLayout = new St.BoxLayout({ vertical: false });
- this.contentLayout.add(mainContentLayout,
- { x_fill: true,
- y_fill: false });
-
- this._iconBin = new St.Bin();
- mainContentLayout.add(this._iconBin,
- { x_fill: true,
- y_fill: false,
- x_align: St.Align.END,
- y_align: St.Align.START });
+ let mainContentLayout = new St.BoxLayout({
+ vertical: false,
+ x_expand: true,
+ y_expand: false,
+ });
+ this.contentLayout.add_child(mainContentLayout);
+
+ this._iconBin = new St.Bin({
+ x_expand: true,
+ });
+ this._iconBin.set_x_align(Clutter.ActorAlign.END);
+ mainContentLayout.add_child(this._iconBin);
let messageLayout = new St.BoxLayout({ vertical: true,
style_class: 'end-session-dialog-layout' });
- mainContentLayout.add(messageLayout,
- { y_align: St.Align.START });
+ mainContentLayout.add_child(messageLayout);
this._subjectLabel = new St.Label({ style_class: 'end-session-dialog-subject' });
- messageLayout.add(this._subjectLabel,
- { x_fill: false,
- y_fill: false,
- x_align: St.Align.START,
- y_align: St.Align.START });
+ messageLayout.add_child(this._subjectLabel);
- this._descriptionLabel = new St.Label({ style_class: 'end-session-dialog-description' });
+ this._descriptionLabel = new St.Label({
+ style_class: 'end-session-dialog-description',
+ y_expand: true,
+ });
this._descriptionLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._descriptionLabel.clutter_text.line_wrap = true;
- messageLayout.add(this._descriptionLabel,
- { y_fill: true,
- y_align: St.Align.START });
+ messageLayout.add_child(this._descriptionLabel);
this._checkBox = new CheckBox.CheckBox();
this._checkBox.connect('clicked', this._sync.bind(this));
this._batteryWarning.clutter_text.line_wrap = true;
messageLayout.add(this._batteryWarning);
- this._scrollView = new St.ScrollView({ style_class: 'end-session-dialog-list' });
+ this._scrollView = new St.ScrollView({
+ style_class: 'end-session-dialog-list',
+ x_expand: true,
+ y_expand: true,
+ });
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
- this.contentLayout.add(this._scrollView,
- { x_fill: true,
- y_fill: true });
+ this.contentLayout.add_child(this._scrollView);
this._scrollView.hide();
this._inhibitorSection = new St.BoxLayout({ vertical: true,
track_hover: true });
box._indexLabel = new St.Label({ style_class: 'candidate-index' });
box._candidateLabel = new St.Label({ style_class: 'candidate-label' });
- box.add(box._indexLabel, { y_fill: false });
- box.add(box._candidateLabel, { y_fill: false });
+ box.add_child(box._indexLabel);
+ box.add_child(box._candidateLabel);
this._candidateBoxes.push(box);
this.add(box);
this._buttonBox = new St.BoxLayout({ style_class: 'candidate-page-button-box' });
- this._previousButton = new St.Button({ style_class: 'candidate-page-button candidate-page-button-previous button' });
+ this._previousButton = new St.Button({
+ style_class: 'candidate-page-button candidate-page-button-previous button',
+ x_expand: true,
+ });
this._previousButton.child = new St.Icon({ style_class: 'candidate-page-button-icon' });
- this._buttonBox.add(this._previousButton, { expand: true });
+ this._buttonBox.add_child(this._previousButton);
- this._nextButton = new St.Button({ style_class: 'candidate-page-button candidate-page-button-next button' });
+ this._nextButton = new St.Button({
+ style_class: 'candidate-page-button candidate-page-button-next button',
+ x_expand: true,
+ });
this._nextButton.child = new St.Icon({ style_class: 'candidate-page-button-icon' });
- this._buttonBox.add(this._nextButton, { expand: true });
+ this._buttonBox.add_child(this._nextButton);
this.add(this._buttonBox);
var Suggestions = GObject.registerClass(
class Suggestions extends St.BoxLayout {
_init() {
- super._init({ style_class: 'word-suggestions', vertical: false });
+ super._init({
+ style_class: 'word-suggestions',
+ vertical: false,
+ x_align: Clutter.ActorAlign.CENTER,
+ });
this.show();
}
/* Add the key in a container, so keys can be padded without losing
* logical proportions between those.
*/
- this.add(this.keyButton, { expand: true, x_fill: true });
+ this.add_child(this.keyButton);
this.connect('destroy', this._onDestroy.bind(this));
this._extended_keys = extendedKeys;
_makeKey(key) {
let label = GLib.markup_escape_text(key, -1);
- let button = new St.Button ({ label: label,
- style_class: 'keyboard-key' });
+ let button = new St.Button ({
+ label: label,
+ style_class: 'keyboard-key',
+ x_expand: true,
+ });
button.keyWidth = 1;
button.connect('button-press-event', () => {
this._emojiPager.connect('emoji', (pager, str) => {
this.emit('emoji-selected', str);
});
- this.add(this._emojiPager, { expand: true });
+ this.add_child(this._emojiPager);
this._pageIndicator = new PageIndicators.PageIndicators(
Clutter.Orientation.HORIZONTAL
);
- this.add(this._pageIndicator, { expand: true, x_fill: false, y_fill: false });
+ this.add_child(this._pageIndicator);
this._pageIndicator.setReactive(false);
let bottomRow = this._createBottomRow();
- this.add(bottomRow, { expand: true, x_fill: false, y_fill: false });
+ this.add_child(bottomRow);
this._emojiPager.setCurrentPage(0);
}
this._currentPage = null;
this._suggestions = new Suggestions();
- this.add(this._suggestions, { x_align: St.Align.MIDDLE, x_fill: false });
+ this.add_child(this._suggestions);
this._aspectContainer = new AspectContainer({ layout_manager: new Clutter.BinLayout() });
- this.add(this._aspectContainer, { expand: true });
+ this.add_child(this._aspectContainer);
this._emojiSelection = new EmojiSelection();
this._emojiSelection.connect('toggle', this._toggleEmoji.bind(this));
Signals: { 'selection': { param_types: [Clutter.Actor.$gtype] } },
}, class Notebook extends St.BoxLayout {
_init() {
- super._init({ vertical: true });
+ super._init({
+ vertical: true,
+ y_expand: true,
+ });
this.tabControls = new St.BoxLayout({ style_class: 'labels' });
this.selectChild(child);
return true;
});
- labelBox.add(label, { expand: true });
+ labelBox.add_child(label);
this.tabControls.add(labelBox);
- let scrollview = new St.ScrollView({ x_fill: true, y_fill: true });
+ let scrollview = new St.ScrollView({ y_expand: true });
scrollview.get_hscroll_bar().hide();
scrollview.add_actor(child);
_scrollToBottom: false };
this._tabs.push(tabData);
scrollview.hide();
- this.add(scrollview, { expand: true });
+ this.add_child(scrollview);
let vAdjust = scrollview.vscroll.adjustment;
vAdjust.connect('changed', () => this._onAdjustScopeChanged(tabData));
style_class: 'shell-link',
label: text
});
+ this.set_x_align(Clutter.ActorAlign.START);
this.get_child().single_line_mode = true;
this._obj = o;
let box = new St.BoxLayout({ vertical: true });
this.add(box);
let windowLink = new ObjLink(this._lookingGlass, metaWindow, metaWindow.title);
- box.add(windowLink, { x_align: St.Align.START, x_fill: false });
+ box.add_child(windowLink);
let propsBox = new St.BoxLayout({ vertical: true, style: 'padding-left: 6px;' });
box.add(propsBox);
propsBox.add(new St.Label({ text: `wmclass: ${metaWindow.get_wm_class()}` }));
let icon = app.create_icon_texture(22);
let propBox = new St.BoxLayout({ style: 'spacing: 6px; ' });
propsBox.add(propBox);
- propBox.add(new St.Label({ text: 'app: ' }), { y_fill: false });
+ propBox.add_child(new St.Label({ text: 'app: ' }));
let appLink = new ObjLink(this._lookingGlass, app, app.get_id());
- propBox.add(appLink, { y_fill: false });
- propBox.add(icon, { y_fill: false });
+ propBox.add_child(appLink);
+ propBox.add_child(icon);
} else {
propsBox.add(new St.Label({ text: '<untracked>' }));
}
let hbox = new St.BoxLayout({ style_class: 'lg-obj-inspector-title' });
this._container.add_actor(hbox);
- let label = new St.Label({ text: 'Inspecting: %s: %s'.format(typeof obj,
- objectToString(obj)) });
+ let label = new St.Label({
+ text: 'Inspecting: %s: %s'.format(typeof obj, objectToString(obj)),
+ x_expand: true,
+ });
label.single_line_mode = true;
- hbox.add(label, { expand: true, y_fill: false });
+ hbox.add_child(label);
let button = new St.Button({ label: 'Insert', style_class: 'lg-obj-inspector-button' });
button.connect('clicked', this._onInsert.bind(this));
hbox.add(button);
reactive: true });
this._eventHandler = eventHandler;
this.add_actor(eventHandler);
- this._displayText = new St.Label();
- eventHandler.add(this._displayText, { expand: true });
+ this._displayText = new St.Label({ x_expand: true });
+ eventHandler.add_child(this._displayText);
eventHandler.connect('key-press-event', this._onKeyPressEvent.bind(this));
eventHandler.connect('button-press-event', this._onButtonPressEvent.bind(this));
_createExtensionDisplay(extension) {
let box = new St.BoxLayout({ style_class: 'lg-extension', vertical: true });
- let name = new St.Label({ style_class: 'lg-extension-name',
- text: extension.metadata.name });
- box.add(name, { expand: true });
- let description = new St.Label({ style_class: 'lg-extension-description',
- text: extension.metadata.description || 'No description' });
- box.add(description, { expand: true });
+ let name = new St.Label({
+ style_class: 'lg-extension-name',
+ text: extension.metadata.name,
+ x_expand: true,
+ });
+ box.add_child(name);
+ let description = new St.Label({
+ style_class: 'lg-extension-description',
+ text: extension.metadata.description || 'No description',
+ x_expand: true,
+ });
+ box.add_child(description);
let metaBox = new St.BoxLayout({ style_class: 'lg-extension-meta' });
box.add(metaBox);
let notebook = new Notebook();
this._notebook = notebook;
- this.add(notebook, { expand: true });
+ this.add_child(notebook);
- let emptyBox = new St.Bin();
- toolbar.add(emptyBox, { expand: true });
+ let emptyBox = new St.Bin({ x_expand: true });
+ toolbar.add_child(emptyBox);
toolbar.add_actor(notebook.tabControls);
this._evalBox = new St.BoxLayout({ name: 'EvalBox', vertical: true });
notebook.appendPage('Evaluator', this._evalBox);
- this._resultsArea = new St.BoxLayout({ name: 'ResultsArea', vertical: true });
- this._evalBox.add(this._resultsArea, { expand: true });
+ this._resultsArea = new St.BoxLayout({
+ name: 'ResultsArea',
+ vertical: true,
+ y_expand: true,
+ });
+ this._evalBox.add_child(this._resultsArea);
- this._entryArea = new St.BoxLayout({ name: 'EntryArea' });
+ this._entryArea = new St.BoxLayout({
+ name: 'EntryArea',
+ y_align: Clutter.ActorAlign.END,
+ });
this._evalBox.add_actor(this._entryArea);
let label = new St.Label({ text: CHEVRON });
this._entryArea.add(label);
- this._entry = new St.Entry({ can_focus: true });
+ this._entry = new St.Entry({
+ can_focus: true,
+ x_expand: true,
+ });
ShellEntry.addContextMenu(this._entry);
- this._entryArea.add(this._entry, { expand: true });
+ this._entryArea.add_child(this._entry);
this._windowList = new WindowList(this);
notebook.appendPage('Windows', this._windowList);
shouldFadeIn: false,
destroyOnClose: true });
- let label = new St.Label({ text: message });
+ let label = new St.Label({
+ text: message,
+ x_align: Clutter.ActorAlign.CENTER,
+ y_align: Clutter.ActorAlign.CENTER,
+ });
- this.contentLayout.add(label, { x_fill: false,
- y_fill: false,
- x_align: St.Align.MIDDLE,
- y_align: St.Align.MIDDLE });
+ this.contentLayout.add_child(label);
this.buttonLayout.hide();
}
});
this._box.add_constraint(this._boxConstraint);
this.add_actor(this._box);
- this._icon = new St.Icon();
- this._box.add(this._icon, { expand: true });
+ this._icon = new St.Icon({ y_expand: true });
+ this._box.add_child(this._icon);
this._label = new St.Label();
this._box.add(this._label);
this._controls = new OverviewControls.ControlsManager(this._searchEntry);
// Add our same-line elements after the search entry
- this.add(this._controls, { y_fill: true, expand: true });
+ this.add_child(this._controls);
}
get dash() {
this.add_actor(this._dashSlider);
this._group.add_actor(this._dashSpacer);
- this._group.add(this.viewSelector, { x_fill: true, expand: true });
+ this._group.add_child(this.viewSelector);
this._group.add_actor(this._thumbnailsSlider);
layout.connect('allocation-changed', this._updateWorkspacesGeometry.bind(this));
this.add_actor(buttonBox);
this._editButton = new St.Button({ label: _("Edit…"),
style_class: 'button',
- x_align: Clutter.ActorAlign.CENTER,
can_focus: true });
+ this._editButton.set_x_align(Clutter.ActorAlign.CENTER);
this._editButton.connect('clicked', () => {
this.setEditionMode(true);
});
this._syncVisibility();
this._separator = new St.Widget({ style_class: 'popup-separator-menu-item',
+ x_expand: true,
y_expand: true,
y_align: Clutter.ActorAlign.CENTER });
- this.add(this._separator, { expand: true });
+ this.add_child(this._separator);
}
_syncVisibility() {
this.add_child(this.label);
- this._statusBin = new St.Bin({ x_align: St.Align.END });
- this.add(this._statusBin, { expand: true, x_align: St.Align.END });
+ this._statusBin = new St.Bin({
+ x_align: St.Align.END,
+ x_expand: true,
+ });
+ this._statusBin.set_x_align(Clutter.ActorAlign.END);
+ this.add_child(this._statusBin);
this._statusLabel = new St.Label({
text: '',
this.add_child(this.label);
this.label_actor = this.label;
- let expander = new St.Bin({ style_class: 'popup-menu-item-expander' });
- this.add(expander, { expand: true });
+ let expander = new St.Bin({
+ style_class: 'popup-menu-item-expander',
+ x_expand: true,
+ });
+ this.add_child(expander);
this._triangle = arrowIcon(St.Side.RIGHT);
this._triangle.pivot_point = new Graphene.Point({ x: 0.5, y: 0.6 });
let label = new St.Label({ style_class: 'run-dialog-label',
text: _("Enter a Command") });
- this.contentLayout.add(label, { x_fill: false,
- x_align: St.Align.START,
- y_align: St.Align.START });
+ this.contentLayout.add_child(label);
let entry = new St.Entry({ style_class: 'run-dialog-entry',
can_focus: true });
entry.label_actor = label;
this._entryText = entry.clutter_text;
- this.contentLayout.add(entry, { y_align: St.Align.START });
+ this.contentLayout.add_child(entry);
this.setInitialKeyFocus(this._entryText);
this._errorBox = new St.BoxLayout({ style_class: 'run-dialog-error-box' });
- this.contentLayout.add(this._errorBox, { expand: true });
+ this.contentLayout.add_child(this._errorBox);
let errorIcon = new St.Icon({ icon_name: 'dialog-error-symbolic',
icon_size: 24,
- style_class: 'run-dialog-error-icon' });
+ style_class: 'run-dialog-error-icon',
+ y_align: Clutter.ActorAlign.CENTER });
- this._errorBox.add(errorIcon, { y_align: St.Align.MIDDLE });
+ this._errorBox.add_child(errorIcon);
this._commandError = false;
- this._errorMessage = new St.Label({ style_class: 'run-dialog-error-label' });
+ this._errorMessage = new St.Label({
+ style_class: 'run-dialog-error-label',
+ y_align: Clutter.ActorAlign.CENTER,
+ });
this._errorMessage.clutter_text.line_wrap = true;
- this._errorBox.add(this._errorMessage, { expand: true,
- x_align: St.Align.START,
- x_fill: false,
- y_align: St.Align.MIDDLE,
- y_fill: false });
+ this._errorBox.add_child(this._errorMessage);
this._errorBox.hide();
_init() {
super._init({ style_class: 'screen-shield-clock', vertical: true });
- this._time = new St.Label({ style_class: 'screen-shield-clock-time' });
- this._date = new St.Label({ style_class: 'screen-shield-clock-date' });
+ this._time = new St.Label({
+ style_class: 'screen-shield-clock-time',
+ x_align: Clutter.ActorAlign.CENTER,
+ });
+ this._date = new St.Label({
+ style_class: 'screen-shield-clock-date',
+ x_align: Clutter.ActorAlign.CENTER,
+ });
- this.add(this._time, { x_align: St.Align.MIDDLE });
- this.add(this._date, { x_align: St.Align.MIDDLE });
+ this.add_child(this._time);
+ this.add_child(this._date);
this._wallClock = new GnomeDesktop.WallClock({ time_only: true });
this._wallClock.connect('notify::clock', this._updateClock.bind(this));
style_class: 'screen-shield-notifications-container' });
this._scrollView.add_actor(this._notificationBox);
- this.add(this._scrollView, { x_fill: true, x_align: St.Align.START });
+ this.add_child(this._scrollView);
this._sources = new Map();
Main.messageTray.getSources().forEach(source => {
_makeNotificationSource(source, box) {
let sourceActor = new MessageTray.SourceActor(source, SUMMARY_ICON_SIZE);
- box.add(sourceActor, { y_fill: true });
+ box.add_child(sourceActor);
let textBox = new St.BoxLayout({ vertical: true });
- box.add(textBox, { y_fill: false, y_align: St.Align.START });
+ box.add_child(textBox);
let title = new St.Label({ text: source.title,
style_class: 'screen-shield-notification-label' });
box.add(sourceBin);
let textBox = new St.BoxLayout({ vertical: true });
- box.add(textBox, { y_fill: false, y_align: St.Align.START });
+ box.add_child(textBox);
let title = new St.Label({ text: source.title,
style_class: 'screen-shield-notification-label' });
obj.sourceBox = new St.BoxLayout({ style_class: 'screen-shield-notification-source',
x_expand: true });
this._showSource(source, obj, obj.sourceBox);
- this._notificationBox.add(obj.sourceBox, { x_fill: false, x_align: St.Align.START });
+ this._notificationBox.add_child(obj.sourceBox);
obj.sourceCountChangedId = source.connect('notify::count', source => {
this._countChanged(source, obj);
vertical: true,
style_class: 'screen-shield-contents-box' });
this._clock = new Clock();
- this._lockScreenContentsBox.add(this._clock, {
- x_fill: true,
- y_fill: true
- });
+ this._lockScreenContentsBox.add_child(this._clock);
this._lockScreenContents.add_actor(this._lockScreenContentsBox);
this._notificationsBox = new NotificationsBox();
this._wakeUpScreenId = this._notificationsBox.connect('wake-up-screen', this._wakeUpScreen.bind(this));
- this._lockScreenContentsBox.add(this._notificationsBox, {
- x_fill: true,
- y_fill: true,
- expand: true
- });
+ this._lockScreenContentsBox.add_child(this._notificationsBox);
this._hasLockScreen = true;
}
this.style_class = 'list-search-result';
this.x_fill = true;
- let content = new St.BoxLayout({ style_class: 'list-search-result-content',
- vertical: false });
+ let content = new St.BoxLayout({
+ style_class: 'list-search-result-content',
+ vertical: false,
+ x_expand: true,
+ });
this.set_child(content);
this._termsChangedId = 0;
- let titleBox = new St.BoxLayout({ style_class: 'list-search-result-title' });
+ let titleBox = new St.BoxLayout({
+ style_class: 'list-search-result-title',
+ y_align: Clutter.ActorAlign.CENTER,
+ });
- content.add(titleBox, { x_fill: true,
- y_fill: false,
- x_align: St.Align.START,
- y_align: St.Align.MIDDLE });
+ content.add_child(titleBox);
// An icon for, or thumbnail of, content
let icon = this.metaInfo['createIcon'](this.ICON_SIZE);
titleBox.add(icon);
}
- let title = new St.Label({ text: this.metaInfo['name'] });
- titleBox.add(title, { x_fill: false,
- y_fill: false,
- x_align: St.Align.START,
- y_align: St.Align.MIDDLE });
+ let title = new St.Label({
+ text: this.metaInfo['name'],
+ y_align: Clutter.ActorAlign.CENTER,
+ });
+ titleBox.add_child(title);
this.label_actor = title;
if (this.metaInfo['description']) {
- this._descriptionLabel = new St.Label({ style_class: 'list-search-result-description' });
- content.add(this._descriptionLabel, { x_fill: false,
- y_fill: false,
- x_align: St.Align.START,
- y_align: St.Align.MIDDLE });
+ this._descriptionLabel = new St.Label({
+ style_class: 'list-search-result-description',
+ y_align: Clutter.ActorAlign.CENTER,
+ });
+ content.add_child(this._descriptionLabel);
this._termsChangedId =
this._resultsView.connect('terms-changed',
this._terms = [];
this._focusChild = null;
- this._resultDisplayBin = new St.Bin({ x_fill: true,
- y_fill: true });
- this.add(this._resultDisplayBin, { expand: true });
+ this._resultDisplayBin = new St.Bin({ x_fill: true });
+ this.add_child(this._resultDisplayBin);
let separator = new St.Widget({ style_class: 'search-section-separator' });
this.add(separator);
Main.overview.toggle();
});
- this._container.add(this.providerInfo, { x_fill: false,
- y_fill: false,
- x_align: St.Align.START,
- y_align: St.Align.START });
+ this._container.add_child(this.providerInfo);
- this._content = new St.BoxLayout({ style_class: 'list-search-results',
- vertical: true });
- this._container.add(this._content, { expand: true });
+ this._content = new St.BoxLayout({
+ style_class: 'list-search-results',
+ vertical: true,
+ x_expand: true,
+ });
+ this._container.add_child(this._content);
this._resultDisplayBin.set_child(this._container);
}
this._content = new MaxWidthBox({ name: 'searchResultsContent',
vertical: true });
- this._scrollView = new St.ScrollView({ x_fill: true,
- y_fill: false,
- overlay_scrollbars: true,
- style_class: 'search-display vfade' });
+ this._scrollView = new St.ScrollView({
+ overlay_scrollbars: true,
+ style_class: 'search-display vfade',
+ x_expand: true,
+ y_expand: true,
+ });
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
this._scrollView.add_actor(this._content);
action.connect('pan', this._onPan.bind(this));
this._scrollView.add_action(action);
- this.add(this._scrollView, {
- x_fill: true,
- y_fill: true,
- expand: true,
- x_align: St.Align.START,
- y_align: St.Align.STAR
- });
+ this.add_child(this._scrollView);
this._statusText = new St.Label({ style_class: 'search-statustext' });
- this._statusBin = new St.Bin({ x_align: St.Align.MIDDLE,
- y_align: St.Align.MIDDLE });
- this.add(this._statusBin, { expand: true });
+ this._statusBin = new St.Bin({ y_expand: true });
+ this.add_child(this._statusBin);
this._statusBin.add_actor(this._statusText);
this._highlightDefault = false;
accessible_name: provider.appInfo.get_name(),
track_hover: true });
+ this.set_y_align(Clutter.ActorAlign.START);
this._content = new St.BoxLayout({ vertical: false,
style_class: 'list-search-provider-content' });
this.set_child(this._content);
super._init({ styleClass: 'mount-dialog' });
this._content = new Dialog.MessageDialogContent({ icon });
- this.contentLayout.add(this._content, { x_fill: true, y_fill: false });
+ this.contentLayout.add_child(this._content);
}
update(message, choices) {
let rtl = grid.get_text_direction() === Clutter.TextDirection.RTL;
if (flags & Gio.AskPasswordFlags.TCRYPT) {
- this._keyfilesLabel = new St.Label(({ style_class: 'prompt-dialog-keyfiles-label',
- visible: false }));
+ this._keyfilesLabel = new St.Label({
+ style_class: 'prompt-dialog-keyfiles-label',
+ visible: false,
+ y_align: Clutter.ActorAlign.CENTER,
+ });
this._hiddenVolume = new CheckBox.CheckBox(_("Hidden Volume"));
content.messageBox.add(this._hiddenVolume);
);
this._keyfilesLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._keyfilesLabel.clutter_text.line_wrap = true;
- content.messageBox.add(this._keyfilesLabel, { y_fill: false, y_align: St.Align.MIDDLE, expand: true });
+ content.messageBox.add_child(this._keyfilesLabel);
this._pimLabel = new St.Label({ style_class: 'prompt-dialog-password-label',
text: _("PIM Number"),
super._init({ styleClass: 'mount-dialog' });
this._content = new Dialog.MessageDialogContent({ icon });
- this.contentLayout.add(this._content, { x_fill: true, y_fill: false });
+ this.contentLayout.add_child(this._content);
- let scrollView = new St.ScrollView({ style_class: 'mount-dialog-app-list' });
+ let scrollView = new St.ScrollView({
+ style_class: 'mount-dialog-app-list',
+ x_expand: true,
+ y_expand: true,
+ });
scrollView.set_policy(St.PolicyType.NEVER,
St.PolicyType.AUTOMATIC);
- this.contentLayout.add(scrollView,
- { x_fill: true,
- y_fill: true });
+ this.contentLayout.add_child(scrollView);
scrollView.hide();
this._applicationList = new St.BoxLayout({ vertical: true });
return;
let item = new ListItem(app);
- this._applicationList.add(item, { x_fill: true });
+ this._applicationList.add_child(item);
item.connect('activate', () => {
// use -1 to indicate Cancel
style_class: 'slider',
can_focus: true,
reactive: true,
- accessible_role: Atk.Role.SLIDER
+ accessible_role: Atk.Role.SLIDER,
+ x_expand: true,
});
this._releaseId = 0;
let icon = new St.Icon({ icon_name: 'display-brightness-symbolic',
style_class: 'popup-menu-icon' });
this._item.add(icon);
- this._item.add(this._slider, { expand: true });
+ this._item.add_child(this._slider);
this._item.connect('button-press-event', (actor, event) => {
return this._slider.startDragging(event);
});
_init(displayName, shortName) {
super._init();
- this.label = new St.Label({ text: displayName });
+ this.label = new St.Label({
+ text: displayName,
+ x_expand: true,
+ });
this.indicator = new St.Label({ text: shortName });
- this.add(this.label, { expand: true });
+ this.add_child(this.label);
this.add(this.indicator);
this.label_actor = this.label;
}
let bin = new St.Bin({ style_class: 'input-source-switcher-symbol' });
let symbol = new St.Label({ text: item.shortName });
bin.set_child(symbol);
- box.add(bin, { x_fill: false, y_fill: false } );
+ box.add_child(bin);
let text = new St.Label({ text: item.displayName });
- box.add(text, { x_fill: false });
+ box.add_child(text);
this.addItem(box, text);
}
this.add_action(action);
let title = ssidToLabel(this._ap.get_ssid());
- this._label = new St.Label({ text: title });
+ this._label = new St.Label({
+ text: title,
+ x_expand: true,
+ });
this.label_actor = this._label;
- this.add(this._label, { x_align: St.Align.START });
+ this.add_child(this._label);
this._selectedIcon = new St.Icon({ style_class: 'nm-dialog-icon',
icon_name: 'object-select-symbolic' });
this.add(this._selectedIcon);
- this._icons = new St.BoxLayout({ style_class: 'nm-dialog-icons' });
- this.add(this._icons, { expand: true, x_fill: false, x_align: St.Align.END });
+ this._icons = new St.BoxLayout({
+ style_class: 'nm-dialog-icons',
+ x_align: Clutter.ActorAlign.END,
+ });
+ this.add_child(this._icons);
this._secureIcon = new St.Icon({ style_class: 'nm-dialog-icon' });
if (this._ap._secType != NMAccessPointSecurity.NONE)
this.contentLayout.style_class = 'nm-dialog-content';
this.contentLayout.add(headline);
- this._stack = new St.Widget({ layout_manager: new Clutter.BinLayout() });
+ this._stack = new St.Widget({
+ layout_manager: new Clutter.BinLayout(),
+ y_expand: true,
+ });
this._itemBox = new St.BoxLayout({ vertical: true });
this._scrollView = new St.ScrollView({ style_class: 'nm-dialog-scroll-view' });
text: _("Use hardware switch to turn off") });
airplaneSubStack.add_actor(this._airplaneInactive);
- this._airplaneBox.add(this._airplaneIcon, { x_align: St.Align.MIDDLE });
- this._airplaneBox.add(this._airplaneHeadline, { x_align: St.Align.MIDDLE });
- this._airplaneBox.add(this._airplaneText, { x_align: St.Align.MIDDLE });
- this._airplaneBox.add(airplaneSubStack, { x_align: St.Align.MIDDLE });
+ this._airplaneBox.add_child(this._airplaneIcon);
+ this._airplaneBox.add_child(this._airplaneHeadline);
+ this._airplaneBox.add_child(this._airplaneText);
+ this._airplaneBox.add_child(airplaneSubStack);
this._stack.add_child(this._airplaneBox);
- this.contentLayout.add(this._stack, { expand: true });
+ this.contentLayout.add_child(this._stack);
this._disconnectButton = this.addButton({ action: this.close.bind(this),
label: _("Cancel"),
this._indicator = this._addIndicator();
this._percentageLabel = new St.Label({ y_expand: true,
y_align: Clutter.ActorAlign.CENTER });
- this.add(this._percentageLabel, { expand: true, y_fill: true });
+ this.add_child(this._percentageLabel);
this.add_style_class_name('power-status');
this._proxy = new PowerManagerProxy(Gio.DBus.system, BUS_NAME, OBJECT_PATH,
can_focus: true,
track_hover: true,
accessible_name: accessibleName,
+ x_expand: true,
style_class: 'system-menu-action' });
+ icon.set_x_align(Clutter.ActorAlign.CENTER);
icon.child = new St.Icon({ icon_name: iconName });
return icon;
}
log('Missing required core component Settings, expect trouble…');
this._settingsAction = new St.Widget();
}
- item.add(this._settingsAction, { expand: true, x_fill: false });
+ item.add_child(this._settingsAction);
this._orientationLockAction = this._createActionButton('', _("Orientation Lock"));
this._orientationLockAction.connect('clicked', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activateLockOrientation();
});
- item.add(this._orientationLockAction, { expand: true, x_fill: false });
+ item.add_child(this._orientationLockAction);
this._systemActions.bind_property('can-lock-orientation',
this._orientationLockAction,
'visible',
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activateLockScreen();
});
- item.add(this._lockScreenAction, { expand: true, x_fill: false });
+ item.add_child(this._lockScreenAction);
this._systemActions.bind_property('can-lock-screen',
this._lockScreenAction,
'visible',
bindFlags);
this._altSwitcher = new AltSwitcher(this._powerOffAction, this._suspendAction);
- item.add(this._altSwitcher, { expand: true, x_fill: false });
+ item.add_child(this._altSwitcher);
this.menu.addMenuItem(item);
this._icon = new St.Icon({ style_class: 'popup-menu-icon' });
this.item.add(this._icon);
- this.item.add(this._slider, { expand: true });
+ this.item.add_child(this._slider);
this.item.connect('button-press-event', (actor, event) => {
return this._slider.startDragging(event);
});
let icon = new St.Icon({ icon_name: item.icon,
icon_size: APP_ICON_SIZE });
- box.add(icon, { x_fill: false, y_fill: false } );
+ box.add_child(icon);
let text = new St.Label({ text: item.label });
- box.add(text, { x_fill: false });
+ box.add_child(text);
this.addItem(box, text);
}
}
}, class ViewSelector extends Shell.Stack {
_init(searchEntry, showAppsButton) {
- super._init({ name: 'viewSelector' });
+ super._init({
+ name: 'viewSelector',
+ x_expand: true,
+ });
this._showAppsButton = showAppsButton;
this._showAppsButton.connect('notify::checked', this._onShowAppsButtonToggled.bind(this));
let title = _("Do you want to keep these display settings?");
let body = this._formatCountDown();
- this._content = new Dialog.MessageDialogContent({ icon, title, body });
+ this._content = new Dialog.MessageDialogContent({
+ icon, title, body,
+ x_expand: true,
+ y_expand: true,
+ });
- this.contentLayout.add(this._content,
- { x_fill: true,
- y_fill: true });
+ this.contentLayout.add_child(this._content);
/* Translators: this and the following message should be limited in length,
to avoid ellipsizing the labels.